package dao

import (
	"main/global"
	"main/internal/model"
)

func GetUserByMobile(mobile string) model.User {
	var user model.User
	if err := global.DB.Where("mobile = ?", mobile).Find(&user).Error; err != nil {
		return model.User{}
	}
	return user
}
func GetUserByMobileAndPassword(mobile string, password string) model.User {
	var user model.User
	if err := global.DB.Where("mobile = ? and password = ?", mobile, password).Find(&user).Error; err != nil {
		return model.User{}
	}
	return user
}
